﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CustomerOrders.aspx.cs" Inherits="Chinesys.UI.Orders.CustomerOrders" %>
<%@ MasterType VirtualPath="~/Site.Master" %>
<%@ Register Src="../Controls/ValidationSummary.ascx" TagName="ValidationSummary"
TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link type="text/css" rel="Stylesheet" href="../Styles/CustomStyles.css" />
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="MainContent" ID="CustomerOrders">
    <script type="text/javascript">
        $(document).ready(function () {

            if ($('#hdnBizRulesException').val().length > 0) {
                var text = $('#hdnBizRulesException').val();
                $('#hdnBizRulesException').val('');
                $('#modalText').text(text);

                $("#modal").overlay({
                    top: 260,
                    mask: {
                        color: '#fff',
                        loadSpeed: 200,
                        opacity: 0.5
                    },
                    closeOnClick: false,
                    load: true
                });

            }

        });
    </script>
    <div>
        <asp:Label ID="lblInfo" CssClass="labelinfo" runat="server" Visible="false" />
        <asp:HiddenField ID="hdnBizRulesException" runat="server" ClientIDMode="Static" />
        <uc1:ValidationSummary ID="validationSummary" runat="server" />
    </div>
    <div style="width:100%; float:right;">
        <asp:Button ID="btnPrint" Text="Imprimir Cupon de Pago" runat="server" 
            onclick="btnPrint_Click" />
    </div>
    <div class="contentDiv">
        <asp:Repeater ID="rptProductsGrid" runat="server" ViewStateMode="Enabled" OnItemCommand="rptProductsGrid_ItemCommand">
            <HeaderTemplate>
                <div class="orderlist">
                    <ul>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <div id="orderitem" class="orderitem">
                        <asp:Image ID="Image1" CssClass="thumbnail" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ProductImageURL")%>' />
                        <div class="ordertitle">
                            <asp:Label ID="lblName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductName")%>' />
                        </div>
                        <div class="description">
                            <asp:Label ID="lblDescription" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductDescription")%>' />
                            <br /><br />
                            <span class="quantity">Cantidad: <%# DataBinder.Eval(Container.DataItem, "Quantity")%> x
                            u$s<%# DataBinder.Eval(Container.DataItem, "ProductPriceInDolars", "{0:0.##}")%>c/u:</span>
                            <br /><br />                           
                            <span class="price">Subtotal: u$s <%# DataBinder.Eval(Container.DataItem, "SubtotalInDolars", "{0:0.##}")%></span>
                        </div>
                        <div style="float:right">
                            <asp:ImageButton ID="ImageButton1" CssClass="item" runat="server" ImageUrl="../Images/Icons/Shopcart-Remove_32.png"
                                ToolTip="Clic aqui para quitar este producto del carrito." CommandName="RemoveFromCart" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID")%>' />
                        </div>
                    </div>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                </ul> </div>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <div id="modal">
        <div>
            <h2>Mensaje del Sistema</h2>
            <p id="modalText">                
            </p>
            <button class="close">
                Cerrar
            </button>
        </div>
    </div>
</asp:Content>
